#include "grap.h"
#include <userint.h>
#define SIZE 9
#define nr 'n'
#define bl 'b'
#define ab ' '
#define X 'x'
#define tmp 'X'
int bl_detection(int  tab[SIZE][SIZE],int cpt);
void plateau (int tab[SIZE][SIZE],int noir,int blanc,int Mevette,int etoile);
int nr_detection(int tab[SIZE][SIZE],int cpt);

void fonction_aide (int tab[SIZE][SIZE], int pion_x)
{
  int i,j;
  static Point cell;
  int noir;
  int blanc;
  int etoile;
  int Mevette;
  int joueur=bl;
  static int help;
  

	GetBitmapFromFile ("pion_nr.bmp", &noir);
	GetBitmapFromFile ("pion_bl.bmp", &blanc);
	GetBitmapFromFile ("etoile.bmp", &etoile);
	GetBitmapFromFile ("Mevette.bmp", &Mevette);  
	
  GetCtrlVal (PANEL, PANEL_AIDES, &help);   
  
  for(i=1;i<SIZE;i++)				 
    {											 
     for(j=1;j<SIZE;j++)				  
     {	
      if(tab[i][j]==ab)
      {
       cell.y= i;
       cell.x= j;
	   SetTableCellVal (PANEL, PANEL_TABLE, cell, Mevette);
	  }
      if(tab[i][j]==nr)
      {
       cell.x=j;
       cell.y=i;
	   SetTableCellVal (PANEL, PANEL_TABLE, cell, noir);
      }
      if(tab[i][j]==bl)
	  {
	  cell.y=i;
	  cell.x=j;
	  SetTableCellVal (PANEL, PANEL_TABLE, cell, blanc);
	  }
      if(tab[i][j]==X)
	  {
	   cell.x=j;
	   cell.y=i;
	   pion_x=pion_x+1;
	   SetTableCellVal (PANEL, PANEL_TABLE, cell, Mevette);
      }
   	 }
	 
		   if(help==1&&tab[i][j]==X)
	  {
	       cell.x=j;
		   cell.y=i;
		   pion_x=pion_x+1;
		   SetTableCellVal (PANEL, PANEL_TABLE, cell, etoile);
	  }
	  else if (help==0 && tab[i][j]==X)
	  {
		   cell.x=j;
		   cell.y=i;
		   pion_x=pion_x+1;
		   SetTableCellVal (PANEL, PANEL_TABLE, cell, Mevette);
	 }
	  
	}


  
  }

	  

